01创建网格<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>

</head>
<body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px"></canvas>
<script src="//cdn.bootcss.com/three.js/r83/three.min.js"></script>
<script type="text/javascript">
    function init() {
        var renderer = new THREE.WebGLRenderer({
            canvas: document.getElementById('mainCanvas')   //渲染器将和 Canvas 元素进行绑定
        });
        renderer.setClearColor(0x000000);       // Canvas 元素背景色
        var scene = new THREE.Scene();      //实例化场景
        
        var camera = new THREE.OrthographicCamera(-5, 5, 3.75, -3.75, 0.1, 100);    //定义照相机 以下是属性
        camera.position.set(25, 25, 25);
        camera.lookAt(new THREE.Vector3(0, 0, 0));
        scene.add(camera);          //将照相机加到场景中

        var light = new THREE.PointLight(0xffffff, 1, 100);
        light.position.set(10, 15, 5);
        scene.add(light);
        
        //var texture = THREE.ImageUtils.loadTexture('../img/030401.png');
        var texture = THREE.ImageUtils.loadTexture('../img/030401.png', {}, function() {  //导入纹理团并且重新绘制
            renderer.render(scene, camera);
        });
        var material = new THREE.MeshLambertMaterial({
            map: texture
        });
        var cube = new THREE.Mesh(new THREE.CubeGeometry(5, 5, 5), material); 
        // var sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 20, 8), material);
        scene.add(cube);                                                          //把长方形加到场景中
        renderer.render(scene, camera); //开始渲染
    }
</script>
</body>

</html>
<!--
    

-->